# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.22.1)

# Declares and names the project.

project("TJVIB2")

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.

add_library( # Sets the name of the library.
        TJVIB2

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        native-lib.cpp

        checkStoppingCriteria.c
        checkStoppingCriteria.h
        computeFiniteDifferences.c
        computeFiniteDifferences.h
        data.h
        diag.c
        diag.h
        eml_mtimes_helper.c
        eml_mtimes_helper.h
        eml_setop.c
        eml_setop.h
        emxutil.h
        emxutil.c
        eye.c
        eye.h
        FFTImplementationCallback.c
        FFTImplementationCallback.h
        finDiffEvalAndChkErr.c
        finDiffEvalAndChkErr.h
        findpeaks.h
        findpeaks.c
        Frequency_dampingratio_estimation_and_plot1219.c
        Frequency_dampingratio_estimation_and_plot1219.h
        Frequency_dampingratio_estimation_and_plot1219_initialize.h
        Frequency_dampingratio_estimation_and_plot1219_initialize.c
        Frequency_dampingratio_estimation_and_plot1219_terminate.h
        Frequency_dampingratio_estimation_and_plot1219_terminate.c
        fsolve.c
        fsolve.h
        linearLeastSquares.c
        linearLeastSquares.h
        mean.h
        mean.c
        minOrMax.c
        minOrMax.h
        mldivide.c
        mldivide.h
        Modalmass_estimation_newchangefinal1219.h
        Modalmass_estimation_newchangefinal1219.c
        Modalmass_estimation_newchangefinal1219_initialize.c
        Modalmass_estimation_newchangefinal1219_initialize.h
        Modalmass_estimation_newchangefinal1219_internal_types.h
        Modalmass_estimation_newchangefinal1219_rtwutil.c
        Modalmass_estimation_newchangefinal1219_rtwutil.h
        Modalmass_estimation_newchangefinal1219_terminate.c
        Modalmass_estimation_newchangefinal1219_terminate.h
        mtimes.c
        mtimes.h
        norm.c
        norm.h
        ppval.c
        ppval.h
        rcond.c
        rcond.h
        rms.c
        rms.h
        rt_nonfinite.h
        rt_nonfinite.c
        rtGetNaN.c
        rtGetNaN.h
        rtGetInf.c
        rtGetInf.h
        rtwtypes.h
        spline.c
        spline.h
        sparse.c
        sparse.h
        sparse1.c
        sparse1.h
        tmwtypes.h
        types.h
        wavedec.c
        wavedec.h
        xnrm2.c
        xnrm2.h
        xzgetrf.c
        xzgetrf.h
        xzlarf.c
        xzlarf.h
        xzlarfg.c
        xzlarfg.h
        )

# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.

find_library( # Sets the name of the path variable.
        log-lib

        # Specifies the name of the NDK library that
        # you want CMake to locate.
        log)

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
        TJVIB2

        # Links the target library to the log library
        # included in the NDK.
        ${log-lib})